#ifndef DEBUG_UTILS_H
#define DEBUG_UTILS_H
/**
 * Calculate the L2 norm of an array and print the result when rank is 0
 * 
 * @param classname The class identifier (e.g., "Cdebug" or "Fdebug")
 * @param TAG The identifier to print with the norm
 * @param array The array to calculate the norm for
 * @param size The size of the array
 * @param rank The MPI rank (only rank 0 will print)
 * @param step Optional step counter to make each TAG unique (default: 0)
 */
// debug_utils.h
#ifdef __cplusplus
extern "C" {
#endif

void debug_print_norm(const char* classname, const char* TAG, float* array, int size, int rank, int step);
void debug_print_norm_d(const char* classname, const char* TAG, double* array, int size, int rank, int step);

#ifdef CUDA_ENABLED
void debug_print_norm_cuda(const char* classname, const char* TAG, float* array, int size, int rank, int step);
void debug_print_norm_cuda_d(const char* classname, const char* TAG, double* array, int size, int rank, int step);
#endif

#ifdef __cplusplus
} // extern "C"
#endif

//extern void debug_print_norm(const char* classname, const char* TAG, float* array, int size, int rank, int step);

#endif // DEBUG_PRINT_H
